home *** CD-ROM | disk | FTP | other *** search
- on enterFrame
- global x, y, r, theta
- puppetSprite(13, 1)
- put " " into field "Answer1"
- put " " into field "Answer2"
- updateStage()
- set x to random(400) - 200
- if x = 0 then
- set x to random(200)
- end if
- put x into field "X"
- set y to random(400) - 200
- if y = 0 then
- set y to random(200)
- end if
- put y into field "Y"
- set the floatPrecision to 5
- set r to float(sqrt(float(x * x) + float(y * y)))
- set theta to float(atan(float(y) / float(x)))
- if (x > 0) and (y < 0) then
- set theta to (2.0 * PI) + theta
- end if
- if (x < 0) and (y > 0) then
- set theta to PI + theta
- end if
- if (x < 0) and (y < 0) then
- set theta to PI + theta
- end if
- set the floatPrecision to 1
- put r into field "R"
- if random(10) > 5 then
- set the floatPrecision to 1
- put theta * 180.0 / PI into field "Theta"
- set the hilite of cast "Degrees" to 1
- set the hilite of cast "Radians" to 0
- set the castNum of sprite 13 to 50
- else
- set the floatPrecision to 2
- put theta into field "Theta"
- set the castNum of sprite 13 to 51
- set the hilite of cast "Degrees" to 0
- set the hilite of cast "Radians" to 1
- end if
- updateStage()
- put cos(theta) into field "Cos"
- put sin(theta) into field "Sin"
- set the textSize of field "Answer1" to 32
- set the textSize of field "Answer2" to 32
- set the textSize of field "X" to 32
- set the textSize of field "Y" to 32
- set the textSize of field "R" to 32
- set the textSize of field "Theta" to 32
- set the textStyle of field "Answer1" to "bold"
- set the textStyle of field "Answer2" to "bold"
- set the textStyle of field "X" to "bold"
- set the textStyle of field "Y" to "bold"
- set the textStyle of field "R" to "bold"
- set the textStyle of field "Theta" to "bold"
- end
-